package com.xzs.kit.base.exception;

/**
 * 错误码
 * @author :Victor.Xiao
 * @date : 2017/12/12 15:40
 */
public  enum ErrorCode {
	/**
	 * 成功状态码
	 */
	SUCCESS("1000","成功","SUCCESS"),

	/**
	 * 授权相关
	 */
	CODE_AUTH_ERROR	("1001","授权失败"),
	CODE_REQ_AUTH_ERROR	("1002","请求授权失败"),
	CODE_REQ_OBJ_ERROR	("1003","请求对象错误"),
	CODE_OP_AUTH_ERROR ("1004","操作无权限"),
	CODE_NO_LOGIN_ID("1007","登录名错误"),
	CODE_PASSWORD_ERROR("1008","密码错误"),
	CODE_LOGIN_ID_EXISTS("1009","用户名已经注册"),
	CODE_AUTH_EXPIRED("1010","授权过期"),

	/**
	 * 数据库相关
	 */
	CODE_SQL_ERROR ("1050","数据库查询出错","sql error"),
	CODE_SQL_OPERATE_ERROR ("1052","数据库操作出错","sql error"),
	CODE_SQL_NODATA_ERROR ("1053","无此数据" ),
	CODE_SQL_DUPLICATE_ERROR ("1054","数据重复" ),

	CODE_UPLOAD_FILE_ERROR ("1100","上传文件出错","upload file error"),

	/**
	 * 其它
	 */
	CODE_COMMIT_DUPLICATE_ERROR ("9996","重复提交" ),
	CODE_SERVICE_ERRER("9997","调用服务错误"),
	CODE_PARAM_ERROR	("9998","参数错误"),
	CODE_ERROR("9999","未知错误")
	;
	private String code;
	private String message;
	private String enMessage;

	private ErrorCode(String code, String message) {
		this.code = code;
		this.message = message;
	}
	private ErrorCode(String code, String message, String enMessage) {
		this.code = code;
		this.message = message;
		this.enMessage = enMessage;
	}


	public String getCode() {
		return this.code;
	}
	public String getMessage(){
		return this.message;
	}

	public String getEnMessage() {
		return enMessage;
	}
	public void setCode(String code) {
		this.code = code;
	}


}